package me.tuyou.hibernate;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {

	public static Configuration config;
	public static SessionFactory sessionFactory;

	static {
		config = new Configuration().configure();
		sessionFactory = config.buildSessionFactory();
	}

	public static Session getSession() {
		Session session = sessionFactory.openSession();
		return session;
	}
}